package org.scboy.utils.entitys.coobi;

import cn.hutool.log.Log;
import cn.hutool.log.LogFactory;

/**
 * SQL缓存类
 */
public class SQLConfig {
	
	private Log log = LogFactory.get();
	
	/**
	 * SQLID
	 */
	private String id;
	
	/**
	 * 配置名称
	 */
	private String name;
	
	/**
	 * 配置备注
	 */
	private String note;
	
	/**
	 * SQL配置信息
	 */
	private SQLEntity sqlEntity=new SQLEntity();
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	
	public SQLEntity getSqlEntity() {
		return sqlEntity;
	}
	public void setSqlEntity(SQLEntity sqlEntity) {
		this.sqlEntity = sqlEntity;
	}
	public void setSql(SQLEntity sqlEntity) {
		if(this.sqlEntity.getVersion()<sqlEntity.getVersion()){
			log.info("SQL配置["+this.getId()+"]内存版本["+this.sqlEntity.getVersion()+"]小于更新版本["+sqlEntity.getVersion()+"]更新内存版本。");
			this.setSqlEntity(sqlEntity);
		}
	}
}
